package edu.sctu.practice.class02.hujie.cgs.assign05.four;

/**
 * Created by hp on 2015/12/14.
 */
public class Class1 {
    public static void main(String[] args) {
        int a[] = {34, 12, 8, 67, 88, 23, 98, 101, 119, 56};
        Sort_Demo1 m1 = new Sort_Demo1();
        Sub_Sort_Demo1 m2 = new Sub_Sort_Demo1();
        System.out.println("排序前的数据为：");
        for (int i = 0; i < 10; i++)
            System.out.print(a[i] + ",");

        //调用父类中的sort()方法
        m1.sort(a.length, a);
        System.out.println("\n按升序排列的数据为：");
        for (int i = 0; i < 10; i++)
            System.out.print(a[i] + ",");

        //调用子类中的sort()方法，该方法实现对父类中方法的覆盖
        m2.sort(a.length, a);
        System.out.println("\n按降序排列的数据为：");
        for (int i = 0; i < 10; i++)
            System.out.print(a[i] + ",");
    }
}
